package com.tommy.ddp.disposeHandler.special
{
	import com.tommy.ddp.MainManager;
	import com.tommy.ddp.box.DdpBox;
	import com.tommy.ddp.definition.BoxExeType;
	import com.tommy.ddp.manager.DisposeBoxManager;
	import com.tommy.ddp.swapHandle.SubDisposeVo;
	
	import flash.utils.setTimeout;

	/**
	 * 十字架消除
	 * @author hongxuan
	 * 
	 */	
	public class DisposeCrossHandler implements ISpecialDisposeHandler
	{
		private var _vect:Vector.<DdpBox>;
		
		public function DisposeCrossHandler()
		{
		}
		
		public function dispose(vect:Vector.<DdpBox>,n:Number):void
		{
			_vect = vect;
			var b:DdpBox = _vect[0];
			b.setType(b.colorType,BoxExeType.X_AXIS_ALL);
			b = _vect[1];
			b.setType(b.colorType,BoxExeType.Y_AXIS_ALL);
			
			MainManager.game.tips = "十字消除……";
			setTimeout(_dispose,n);
		}
		
		private function _dispose():void
		{
			var vo:SubDisposeVo = new SubDisposeVo();
			vo.vect = _vect;
			
			DisposeBoxManager.disposeSubVo(vo);
		}
	}
}